package com.thinking.live.hanlder;


import com.thinking.live.event.RechargeResultReqEvent;
import com.thinking.live.service.RechargeResultService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/***
 @author tangsixiang@hotmail.com
 描述：
 @date 2024年01月10日 9:26

 */
@Component
@Slf4j
public class LivingChargeListener  implements ApplicationListener<RechargeResultReqEvent> {

    @Autowired
    @Lazy
    RechargeResultService rechargeResultService;
    @Override
    @Async
    public void onApplicationEvent(RechargeResultReqEvent event) {
        log.info("return-living-data-2:{}",event.getRechargeResultReq());
        rechargeResultService.inform(event.getRechargeResultReq());
    }
}
